<!doctype html>
<html>
<head>
    <title>Test Page</title>
    <style type="text/css">
        .markup {
            margin: 10px 0 0 300px;
        }
    </style>
</head>
<body class="yui3-skin-sam">
<div class="markup">
    <div id="slider"></div>

    <p>
        <input type="button" id="size" value="Change size">
        <input type="button" id="val" value="Set Value">
        <input type="button" id="disable" value="Disable">
        <!--<input type="button" id="incr" value="incr">-->
    </p>
    <div id="report">0</div>
</div>

<script src="../../../../build/yui/yui.js"></script>
<script>
YUI({
    filter: 'raw'
}).use('slider',function (Y) {

var report = Y.one('#report');

var s = new Y.Slider({
    //axis  : 'y',
    length: '350px',
    min   : -37,
    max   : 218,
    value : 136,
//    minorStep: 3,
    after : {
        valueChange: function (e) {
            report.set('innerHTML',e.newVal);
        }
    }
});

s.set('min', 10);

s.render('#slider');

s.on('railMouseDown', function (e) {
    /*removing this because IE9 just stops here if you don't have the developer tools open,
    * it makes you think mousedown on the rail is broken in a manual test,
    * but it's just that it doesn't know what to do when there's
    * a console command with no console. Y.log() doesn't have this problem.
    */
    //console.log(e);
    Y.log(e + 'this is a Y.log');
});

s.rail.on(['mousedown', 'mouseup', 'click'], function (e) {
    e.type;
    //console.log(e); // using Y.log() instead for IE 9
    Y.log(e + 'this is a Y.log');
});

report.set('innerHTML',s.get('value'));

Y.one('#size').on('click',function () {
    s.set('length','155px');
});
Y.one('#val').on('click',function () {
    s.set('value',s.get('value') === -92 ? 100 : -92);
});
Y.one('#disable').on('click',function () {
    var disabled = !s.get('disabled');
    s.set('disabled',disabled);
    this.set('value', disabled ? "Enable" : "Disable");
});
// Y.one('#incr').on('click',function () {
//     s.set('value', 133);
//     Y.log('myVal' + s.get('value'));
//     s.set('value', 134);
//     Y.log('myVal' + s.get('value'));
// });

});
</script>
</body>
</html>
